<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			*{
				margin: 0;
				padding: 0;
				list-style: none;
			}
			body{
				background-color: #A9A9A9;
			}
			p{
				text-align: center;
			}
			#top{
				width: 43px;
				height: 43px;
				background: url(../img/top.png) no-repeat;
				background-size: 100% 100%;
				position: fixed;
				right: 10px;
				bottom: 30px;
				display: none;
			}
		</style>
	</head>
	<body>
	<span id="top"></span>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
	<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>
		<p>我爱易烊千玺</p>	
	</body>
	<script src="通用兼容文件.js"></script>
	<script>
		window.onload = function(){
		var begin =0, end=0, timer=null;
		 window.onscroll = function(){
			var scrolltop = scroll().top;
			 scrolltop > 0 ? show($('top')):hide($('top'));	 
			 begin = scrolltop;
		 };
		 
		$('top').onclick = function(){
			clearInterval(timer);
		timer =	setInterval(function(){
				begin = begin +(end-begin)*0.5;
				console.log(begin);
				window.scrollTo(0,begin);
			
			
			if(Math.round(begin)=== end){
				clearInterval(timer);
			}
				
			},100);
		}
	
		}
	</script>
</html>
